﻿using Dora.Tools.Enums.AdminUser;
using Dora.Tools.Utility;
using Surging.Core.Common;
using System;
using System.Collections.Generic;

namespace Dora.Services.AdminUser.Dto.ViewDto
{
    public class TasUserListDto
    {
        #region model

        /// <summary>
        ///
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 用户名;如果非空，必须唯一
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile { get; set; }

        /// <summary>
        /// 手机号是否验证
        /// </summary>
        public short MobileIsVerified { get; set; }

        /// <summary>
        /// Email
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// Email是否验证
        /// </summary>
        public short EmailIsVerified { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 性别;0未知1男2女
        /// </summary>
        public int Sex { get; set; }

        /// <summary>
        /// 排序;倒序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>
        public short IsDisabled { get; set; }

        /// <summary>
        /// 是否冻结
        /// </summary>
        public short IsFrozen { get; set; }

        /// <summary>
        /// 是否超级管理员
        /// </summary>
        public short IsSuperAdmin { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string Avatar { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 上次登录时间
        /// </summary>
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 本次登录时间
        /// </summary>
        public DateTime? ThisLoginTime { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        public string JobNumber { get; set; }

        #endregion model

        #region extend

        public List<TasUserRoleMapListDto> UserRoleMapList { get; set; }

        /// <summary>
        /// 所属角色名称，多个角色以英文逗号分隔
        /// </summary>
        public string RoleName { get; set; }

        /// <summary>
        /// 所属部门名称，多个角色以英文逗号分隔
        /// </summary>
        public string DepartmentName { get; set; }

        ///// <summary>
        ///// 推荐人手机号
        ///// </summary>
        //[SugarColumn(IsIgnore = true)]
        //public string RecommendMobile { get; set; }

        /// <summary>
        /// 拥有的权限Key
        /// </summary>
        public List<string> AuthKeyList { get; set; }

        /// <summary>
        /// 员工性别文本
        /// </summary>
        public string SexText
        {
            get
            {
                return ((UserSex)Sex).ToDescription();
            }
        }

        /// <summary>
        /// 是否禁用文本
        /// </summary>
        public string IsDisabledText
        {
            get
            {
                return ((UserIsDisabled)IsDisabled).ToDescription();
            }
        }

        /// <summary>
        /// 是否是所在机构管理员
        /// </summary>
        public int IsAdmin { get; set; }

        /// <summary>
        /// 是否是所在负责人
        /// </summary>
        public int IsLeader { get; set; }

        /// <summary>
        /// 组织机构名称
        /// </summary>
        public string OrgName { get; set; }

        /// <summary>
        /// 组织机构ID
        /// </summary>
        public int OrgId { get; set; }

        /// <summary>
        /// 下级门店数量
        /// </summary>
        public int SubShopCount { get; set; }

        /// <summary>
        /// 子账号列表
        /// </summary>
        public List<TasUserListDto> Children { get; set; }

        #endregion extend
    }
}